package com.tledu;

public class Sort {
    public static void main(String[] args) {
        int[] nums = {1, 3, 5, 2, 4, 12, 6, 7};
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length - 1 -i; j++) {
                if (nums[j] > nums[j + 1]) {
                    // 交换他们的位置
                    int temp = nums[j];
                    nums[j] = nums[j + 1];
                    nums[j + 1] = temp;
                }
            }
        }

        for (int i : nums) {
            System.out.println(i);
        }
    }
}
